#pragma once

#include <string>

#include <xpam/net/address_family.h>
#include <xpam/net/socket_type.h>
#include <xpam/net/socket_protocol.h>
#include <xpam/net/socket_option.h>
#include <xpam/misc/nocopy.h>

namespace xpam
{
    namespace net
    { 
        extern int infinite;

        class base_socket : public xpam::misc::nocopy
        {
        protected:
            int _socket;

        protected:
            base_socket(const address_family & af, const socket_type & type, const socket_protocol & protocol);
        public:
            ~base_socket(void);
            void close();

            bool is_connected();
            bool select(int interval);

            int get_option(const socket_option & so);
            void set_option(const socket_option & so, int val);
        };
    }
}